﻿using System;
using System.Reflection;
using log4net.Config;
using Loki.Utils;
using Luna.Connectors.Google.Test;
using NUnit.Framework;

[SetUpFixture]
public class TestSetup
{
    private TestDataModel _Model = new TestDataModel();

    [SetUp]
    public void Initialize()
    {
        var L_Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Luna.Connectors.Google.Test.log4net.config");
        XmlConfigurator.Configure(L_Stream);
        L_Stream.Dispose();

        // Initialize Data engine
        try
        {
            ToolKit.Engine.DefineDataModel(_Model);
            _Model.Initialize();
        }
        catch (Exception ex)
        {
            Console.Out.WriteLine(ex.Message);
        }
    }

    [TearDown]
    public void Clean()
    {
        ToolKit.Reset();
    }
}